/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jskat.basic;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author Kai
 */
public class DeckTest {
    
    public DeckTest() {
    }
    
    @BeforeClass
    public static void setUpClass() {
    }
    
    @AfterClass
    public static void tearDownClass() {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }

    /**
     * Test of init method, of class Deck.
     */
    @Test
    public void testInit() {
        System.out.println("init");
        Deck instance = new Deck();
        instance.init();
    }

    /**
     * Test of shuffle method, of class Deck.
     */
    @Test
    public void testShuffle() {
        System.out.println("shuffle");
        Card [] tmpCards = new Card[32];
        Card[] tmpCardsShuffled = new Card[32];
        for(int i = 0; i < tmpCards.length; i++)
        {
            tmpCards[i] = new Card();
            tmpCardsShuffled[i] = new Card();
            tmpCards[i].setValue(i);
            tmpCardsShuffled[i].setValue(i);
        }
        
        
        Deck tmpInstance = new Deck();
        tmpInstance.setCards(tmpCardsShuffled);
        tmpInstance.shuffle();
        int tmpDiffer = 0;
        for(int i = 0; i < tmpCards.length; i++)
        {
            System.out.println(tmpInstance.getCards()[i].getValue());
            System.out.println(tmpCards[i].getValue());
            if(tmpCards[i].getValue() != tmpInstance.getCards()[i].getValue())
            {
                tmpDiffer = 1;
            }
        }
        
        
        //Assert.assertArrayEquals(tmpCards, tmpInstance.getCards());
        Assert.assertEquals(1, tmpDiffer);
        
        for(int i = 0; i < tmpCards.length; i++)
        {
            System.out.print(tmpCards[i].getValue() + " ");
            
        }
        System.out.println("");
        for(int i = 0; i < tmpCardsShuffled.length; i++)
        {
            System.out.print(tmpInstance.getCards()[i].getValue() + " ");
        }
        
    }

    /**
     * Test of deal method, of class Deck.
     */
    @Test
    public void testDeal() {
        System.out.println("deal");
        Deck instance = new Deck();
        
    }
}
